<form class="form-inline" method="get">
    <div class="form-group col-xs-4">
        <button type="button" class="btn btn-primary" onclick="modal('{:url(\'addPresell\')}','添加预售')">
            添加预售
        </button>
    </div>
</form>
<hr>

<table class="table table-striped">
    <thead>
    <tr>
        <td>ID</td>
        <td>名称</td>
        <td>图标</td>
        <td>排序</td>
        <td>开售时间</td>
        <td>操作</td>
    </tr>
    </thead>
    <tbody>
    {volist name="list" id="item"}
    <tr>
        <td>{$item.id}</td>

        <td>{$item.title}</td>
        <td>
            <a href="javascript:void(0);" onclick="ejectImg('{$item.img_url}','预售【{$item.title}】图标');">
                <img style="width:100px;" src="{$item.img_url}">
            </a>
        </td>
        <td>{$item.display_order}</td>
        <td>{$item.end_time|show_datetime}</td>
        <td>

            <a href="javascript:void(0)" class="btn btn-primary btn-sm"
               onclick="modal('{:url(\'editPresell\',array(\'id\'=>$item[\'id\']))}','编辑')">编辑</a>
            <a href="javascript:void(0)" class="btn btn-danger btn-sm" data-toggle="confirm" data-title="删除"
               data-content="确定要删除吗？删除后当前预售下商品自动归为普通商品"
               data-url="{:url('delpresell',array('id'=>$item['id']))}">删除</a>

        </td>
    </tr>
    {/volist}
    </tbody>
</table>

<div class="row">
    <div class="col-xs-12" style="text-align: right;">
        {$page}
    </div>
</div>
<script src="__PUBLIC__/vendors/select2/js/select2.min.js"></script>
<script type="application/javascript">
    $(function () {

        //获取分类
        $("#category-selector").select2({
            placeholder: "选择轮播类型",
            allowClear: true
        });
    });
</script>